﻿package mortal.game.view.heroArena.view
{
    import com.gengine.global.*;
    import extend.language.*;
    import flash.text.*;
    import mortal.common.*;
    import mortal.common.font.*;
    import mortal.game.manager.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class HeroArenaMatchWaitingView extends View
    {
        private var _matchWaitingTime:SecTimerCountView;
        private static var _instance:HeroArenaMatchWaitingView;

        public function HeroArenaMatchWaitingView()
        {
            this.layer = LayerManager.msgTipLayer;
            this.resetPosition();
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.mouseEnabled = false;
            this.mouseChildren = false;
            var _loc_1:* = new GTextFormat(FontUtil.songtiName, 16, 16580352);
            _loc_1.align = TextFormatAlign.RIGHT;
            _loc_1.bold = true;
            this._matchWaitingTime = UIFactory.secTimeCountView(Language.getString(41550), 0, 0, 200, 30, this, _loc_1);
            return;
        }// end function

        public function startCount(param1:int = 0) : void
        {
            this._matchWaitingTime.startCount(param1);
            return;
        }// end function

        public function stopCount() : void
        {
            if (this._matchWaitingTime && this._matchWaitingTime.running)
            {
                this._matchWaitingTime.stop();
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._matchWaitingTime.dispose(param1);
            this._matchWaitingTime = null;
            return;
        }// end function

        public function resetPosition() : void
        {
            this.x = Global.stage.stageWidth / 2 + 100 - 200;
            this.y = Global.stage.stageHeight / 2 - 120 + 107;
            return;
        }// end function

        public static function get instance() : HeroArenaMatchWaitingView
        {
            if (_instance == null)
            {
                _instance = new HeroArenaMatchWaitingView;
            }
            return _instance;
        }// end function

        public static function isViewShow() : Boolean
        {
            return _instance && !_instance.isHide;
        }// end function

    }
}
